home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 02 - 1986 / 02.08 Aug 86.sit / 02.08 Aug 86 / basic / benchmark programs / Cursor User < prev    next >
Encoding:
Text File  |  1986-06-17  |  1.8 KB  |  73 lines  |  [TEXT/MSBB]

  1. 'Cursor User
  2. 'This program loads cursors made by
  3. 'Dave Kelly's Basic School in the 
  4. 'August 1985, MacTutor
  5.  
  6. 'After loading the cursors,
  7. 'each cursor may be selected
  8. 'from the menu, thence displayed
  9. 'on the screen
  10.  
  11. 'Copyright Dec. 1985, Don Fullmer
  12.  
  13. WINDOW 1,"Cursors...",(2,45)-(510,340),1
  14. WINDOW OUTPUT 1
  15. araysize%=340 'Maximum of 10 cursors to load
  16. DIM entire%(araysize%)
  17. FOR i=1 TO 5:MENU i,0,0,"":NEXT  'clear menu bar
  18. MENU 1,0,1,"Control"
  19. MENU 1,1,1,"QUIT"
  20. MENU 2,0,1,"Load Cursors"
  21. MENU 2,1,1,"All..."
  22. ON MENU GOSUB checkmenu
  23. MENU ON
  24. loop:GOTO loop
  25. checkmenu:
  26.     menunumber=MENU(0)
  27.     menuitem=MENU(1):MENU
  28.     ON menunumber GOSUB Control, LoadCursor
  29. RETURN
  30. Control:
  31.     ON menuitem GOSUB QUIT
  32. RETURN
  33. LoadCursor:    'Current Cursor (CC)
  34.     IF menuitem=1 THEN ON menuitem GOSUB allcursors:RETURN
  35.     MENU OFF
  36.     CCIndex%=(menuitem-2)*34
  37.     SETCURSOR(VARPTR(entire%(CCIndex%)))
  38.     MENU ON
  39. RETURN
  40. allcursors:
  41.     CLS
  42.     LOCATE 16,1
  43.     a%=1
  44.     count%=1
  45.     ERASE entire%                  'this feature lets us reload
  46.     DIM entire%(araysize%)    'a new sequence of cursor files
  47. again:
  48.     filename$=FILES$(1,"CURS")   '"CURS" for files created by
  49.     IF filename$="" THEN exitload  ' Dave Kelly's program
  50.     OPEN filename$ FOR INPUT AS #1
  51.     FOR i=0 TO 33
  52.         INPUT #1, entire%(index%)
  53.         index%=count%+i
  54.     NEXT
  55.     CLOSE #1
  56.     flnm$=RIGHT$(filename$,LEN(filename$)-(INSTR(filename$, ":")))
  57.     MENU 2,a%+1,1,flnm$
  58.     count%=count%+34
  59.     IF LEN(flnm$) >11 THEN flnm$=LEFT$(flnm$,11)
  60.     PRINT USING "###";a%;:PRINT " ";flnm$,  'keeping a visual
  61.     IF a% MOD 3=0 THEN PRINT                            'list of the files
  62.     a%=a%+1
  63.     IF a%=11 THEN exitload                  'maximum of 10 files...
  64.     GOTO again
  65. exitload:
  66. RETURN
  67.  
  68. QUIT:
  69.     MENU RESET
  70.     WINDOW CLOSE 1
  71.     END
  72.     
  73.